﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        /// <summary>
        /// Get Orthodox easter for requested year
        /// </summary>
        /// <param name="year">Year of easter</param>
        /// <returns>DateTime of Orthodox Easter</returns>
        public static DateTime GetOrthodoxEaster(int year)
        {
            int remain19 = year % 19;
            int remain7 = year % 7;
            int remain4 = year % 4;

            int remain30 = (19 * remain19 + 16) % 30;
            int a = (2 * remain4 + 4 * remain7 + 6 * remain30) % 7;
            int b = (19 * remain19 + 16) % 30;
            int key = b + a + 3;

            // Easterdate
            int month = 4;
            int day = key;
            if (key > 30)
            {
                month = 5;
                day = key - 30;
            }

            return new DateTime(year, month, day);
        }

        static void Main(string[] args)
        {
            int year = 2013;
            Console.WriteLine(GetOrthodoxEaster(year));
        }
    }
}
